package com.fly.show.notepad.action;
//NewAction.java

import org.eclipse.jface.action.Action;
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.swt.SWT;

import com.fly.show.notepad.FileManager;
import com.fly.show.notepad.MainWindow;

public class NewAction extends Action
{
    public NewAction()
    {
        super();
        setText("新建(&N)");
        this.setAccelerator(SWT.ALT + SWT.SHIFT + 'N');
        setToolTipText("新建");
        setImageDescriptor(ImageDescriptor.createFromFile(NewAction.class, "icons\\new.gif"));
    }
    
    @Override
    public void run()
    {
        MainWindow.getApp().getContent().setText("");
        MainWindow.getApp().setManager(new FileManager());
    }
}